package main

import "fmt"

//作业：判断从键盘的输入，忽略大小写，判断字母是否为回文

func main() {
	var str, str1, str2 string
	fmt.Println("请从键盘进行输入：")
	fmt.Scanln(&str)
	for _, char := range str {
		if 'A' <= char && char <= 'Z' {
			// 大写转小写
			char += 'a' - 'A'
		}
	}

	for _, char := range str {
		if ('a' <= char && char <= 'z') || (char >= '0' && char <= '9') {
			str1 = str1 + string(char)
			str2 = string(char) + str2

		}

	}
	println("str1 = ", str1)
	println("str2 = ", str2)
	if str1 == str2 {
		println("该输入是一段回文！")
	} else {
		println("该输入不是回文!")
	}
}
